// pages/signin/signin.js
wx.cloud.init()
const db = wx.cloud.database()
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },
  tourist(){
    db.collection('test').get().then(res => {
      wx.setStorageSync('id', res.data.filter(e =>{ return e.username == 'admin'})[0]._id)
      wx.setStorageSync('name', res.data.filter(e =>{ return e.username == 'admin'})[0].username)
      wx.switchTab({
        url: '../userConsole/userConsole'
      })
    })
  },
  staff(){
    wx.redirectTo({
      url: '../index/index'
    })
  }
})